﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace EmoneyWeiXinEntity
{
    public class NewsEntity : ModelBase
    {
        #region 成员变量
        private Int32 _sign;//
        private Int32 _nid = 0;//
        private string _sid = "";//
        private string _author = "";//
        private System.DateTime _ctime = DateTime.Now;//
        private System.DateTime _ptime = DateTime.Now;//
        private string _title = "";//
        private string _keyword = "";//
        private string _summary = "";//
        private string _content = "";//
        private Int32 _step = 0;//
        private string _stock = "";//
        private string _source = "";//
        private Int32 _nature = 0;//
        private string _outsideurl = "";//
        private string _imageurl = "";//
        private Int32 _inputer = 0;//
        private System.DateTime _inputtime = DateTime.Now;//
        private System.DateTime _updatetime = DateTime.Now;//
        private Int32 _pubstatus = 0;//
        private Int32 _puber = 0;//
        private System.DateTime _pubtime = DateTime.Now;//
        private Boolean _isactive = true;//
        #endregion

        #region 构造函数
        public NewsEntity()
        {
        }
        public NewsEntity(DataRow datarow)
            : this()
        {
            buildByDataRow(datarow);
        }
        #endregion

        #region 公有属性
        /// <summary>
        /// Sign
        /// </summary>
        public Int32 Sign
        {
            get
            {
                return _sign;
            }
            set
            {
                _sign = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 nid
        {
            get
            {
                return _nid;
            }
            set
            {
                _nid = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string sid
        {
            get
            {
                return _sid;
            }
            set
            {
                _sid = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string author
        {
            get
            {
                return _author;
            }
            set
            {
                _author = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public System.DateTime ctime
        {
            get
            {
                return _ctime;
            }
            set
            {
                _ctime = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public System.DateTime ptime
        {
            get
            {
                return _ptime;
            }
            set
            {
                _ptime = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string title
        {
            get
            {
                return _title;
            }
            set
            {
                _title = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string keyword
        {
            get
            {
                return _keyword;
            }
            set
            {
                _keyword = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Summary
        {
            get
            {
                return _summary;
            }
            set
            {
                _summary = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string content
        {
            get
            {
                return _content;
            }
            set
            {
                _content = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 step
        {
            get
            {
                return _step;
            }
            set
            {
                _step = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Stock
        {
            get
            {
                return _stock;
            }
            set
            {
                _stock = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Source
        {
            get
            {
                return _source;
            }
            set
            {
                _source = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Nature
        {
            get
            {
                return _nature;
            }
            set
            {
                _nature = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string OutsideUrl
        {
            get
            {
                return _outsideurl;
            }
            set
            {
                _outsideurl = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ImageUrl
        {
            get
            {
                return _imageurl;
            }
            set
            {
                _imageurl = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 inputer
        {
            get
            {
                return _inputer;
            }
            set
            {
                _inputer = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public System.DateTime inputTime
        {
            get
            {
                return _inputtime;
            }
            set
            {
                _inputtime = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public System.DateTime updateTime
        {
            get
            {
                return _updatetime;
            }
            set
            {
                _updatetime = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 PubStatus
        {
            get
            {
                return _pubstatus;
            }
            set
            {
                _pubstatus = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Puber
        {
            get
            {
                return _puber;
            }
            set
            {
                _puber = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public System.DateTime PubTime
        {
            get
            {
                return _pubtime;
            }
            set
            {
                _pubtime = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public Boolean isActive
        {
            get
            {
                return _isactive;
            }
            set
            {
                _isactive = value;
            }
        }
        #endregion

        #region 成员函数
        private void buildByDataRow(DataRow datarow)
        {
            this.nid = (((datarow["nid"] == DBNull.Value) || (datarow["nid"] == null)) ? 0 : Convert.ToInt32(datarow["nid"]));
            this.sid = (((datarow["sid"] == DBNull.Value) || (datarow["sid"] == null)) ? "" : Convert.ToString(datarow["sid"]));
            this.author = (((datarow["author"] == DBNull.Value) || (datarow["author"] == null)) ? "" : Convert.ToString(datarow["author"]));
            this.ctime = (((datarow["ctime"] == DBNull.Value) || (datarow["ctime"] == null)) ? DateTime.Now : Convert.ToDateTime(datarow["ctime"]));
            this.ptime = (((datarow["ptime"] == DBNull.Value) || (datarow["ptime"] == null)) ? DateTime.Now : Convert.ToDateTime(datarow["ptime"]));
            this.title = (((datarow["title"] == DBNull.Value) || (datarow["title"] == null)) ? "" : Convert.ToString(datarow["title"]));
            this.keyword = (((datarow["keyword"] == DBNull.Value) || (datarow["keyword"] == null)) ? "" : Convert.ToString(datarow["keyword"]));
            this.Summary = (((datarow["Summary"] == DBNull.Value) || (datarow["Summary"] == null)) ? "" : Convert.ToString(datarow["Summary"]));
            this.content = (((datarow["content"] == DBNull.Value) || (datarow["content"] == null)) ? "" : Convert.ToString(datarow["content"]));
            this.step = (((datarow["step"] == DBNull.Value) || (datarow["step"] == null)) ? 0 : Convert.ToInt32(datarow["step"]));
            this.Stock = (((datarow["Stock"] == DBNull.Value) || (datarow["Stock"] == null)) ? "" : Convert.ToString(datarow["Stock"]));
            this.Source = (((datarow["Source"] == DBNull.Value) || (datarow["Source"] == null)) ? "" : Convert.ToString(datarow["Source"]));
            this.Nature = (((datarow["Nature"] == DBNull.Value) || (datarow["Nature"] == null)) ? 0 : Convert.ToInt32(datarow["Nature"]));
            this.OutsideUrl = (((datarow["OutsideUrl"] == DBNull.Value) || (datarow["OutsideUrl"] == null)) ? "" : Convert.ToString(datarow["OutsideUrl"]));
            this.ImageUrl = (((datarow["ImageUrl"] == DBNull.Value) || (datarow["ImageUrl"] == null)) ? "" : Convert.ToString(datarow["ImageUrl"]));
            this.inputer = (((datarow["inputer"] == DBNull.Value) || (datarow["inputer"] == null)) ? 0 : Convert.ToInt32(datarow["inputer"]));
            this.inputTime = (((datarow["inputTime"] == DBNull.Value) || (datarow["inputTime"] == null)) ? DateTime.Now : Convert.ToDateTime(datarow["inputTime"]));
            this.updateTime = (((datarow["updateTime"] == DBNull.Value) || (datarow["updateTime"] == null)) ? DateTime.Now : Convert.ToDateTime(datarow["updateTime"]));
            this.PubStatus = (((datarow["PubStatus"] == DBNull.Value) || (datarow["PubStatus"] == null)) ? 0 : Convert.ToInt32(datarow["PubStatus"]));
            this.Puber = (((datarow["Puber"] == DBNull.Value) || (datarow["Puber"] == null)) ? 0 : Convert.ToInt32(datarow["Puber"]));
            this.PubTime = (((datarow["PubTime"] == DBNull.Value) || (datarow["PubTime"] == null)) ? DateTime.Now : Convert.ToDateTime(datarow["PubTime"]));
            this.isActive = (((datarow["isActive"] == DBNull.Value) || (datarow["isActive"] == null)) ? true : Convert.ToBoolean(datarow["isActive"]));
        }
        #endregion

    }
}
